#include "thread_func.hpp"
#include <iostream>
#include <thread>
#ifdef _WIN32
    #include <windows.h>
#endif // _WIN32

void worker_thread_func()
{
    std::cout << "worker_thread GetProcessId: " << ThreadFunc::GetProcessId()
              << " GetThreadId: " << ThreadFunc::GetThreadId() << std::endl;
}

void Test()
{
    std::cout << "main_thread GetProcessId: " << ThreadFunc::GetProcessId()
              << " GetThreadId: " << ThreadFunc::GetThreadId() << std::endl;
    ThreadFunc::SleepFor(1000);
    std::thread t1(worker_thread_func);
    ThreadFunc::SleepFor(1000);
    std::thread t2(worker_thread_func);
    ThreadFunc::SleepFor(1000);
    std::thread t3(worker_thread_func);
    ThreadFunc::SleepFor(1000);
    t1.join();
    t2.join();
    t3.join();
}

int main()
{
#ifdef _WIN32
    SetConsoleCP(65001);
    SetConsoleOutputCP(65001);
#endif
    Test();
}
